package U2;

public class Student {
    private String Num;   //学号
    private String Name;   //姓名
    private int Math;     //数学成绩
    private int Chinese;  //语文成绩
    private int English;   //英语成绩

    public Student() {}
    public Student(String Num, String Name) {

    }
    public void setNum(String Num) {
        this.Num = Num;
    }

    public String getNum() {
        return this.Num;
    }
    public void setName(String Name) {
        this.Name = Name;
    }
    public String getName(){
        return this.Name;
    }

    public int getMath() {
        return Math;
    }

    public void setMath(int Math) {
        this.Math = Math;
    }

    public int getChinese() {
        return Chinese;
    }

    public void setChinese(int Chinese) {
        this.Chinese = Chinese;
    }
    public int getEnglish(){
        return English;
    }
    public void setEnglish(int English){
        this.English=English;
    }
    public int getTotal() {
        return this.getMath() + this.getChinese() + this.getEnglish();
    }

    public double getAverage() {
        return this.getTotal() / 3.0;
    }

    public String toString() {
        return String.format(
                "%s, %s，%s, %s, %s",
                this.getNum(), this.getName(), this.getMath(), this.getChinese(), this.getEnglish()
        );
    }
}

